package com.sven.helloconsumer;

import com.sven.helloapi.HelloServiceAPI;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//创建Feign客户端，同时也创建了一个名为“hello-service”的Ribbon客户端
// @FeignClient(value = "hello-service", fallbackFactory = HelloFeginServiceFallbackFactory.class)
@FeignClient(value = "hello-service", fallback = HelloFeginServiceFallback.class)
public interface HelloFeginService extends HelloServiceAPI {

    /**
     *  这里 getMapping(RequestMapping) 是给Feign看的 get请求 hello-service/hello6?name={1}
     * 	(@RequestParam(value = "name") 也是给Feign看的
     *	fegin通过读取接口上的注解（springMVC的注解）组装真正请求的url,，发出http请求
     * 	HttpClient Http协议
     */

    /**
     * 发出的请求长这个样子
     * http://hello-service/hello/hello1
     * http://hello-service/hello/hello8
     */

    @RequestMapping(value = "/hello/hello1", method = RequestMethod.GET)
    String hello1();
}
